<template>
  <div :class="topClass">
    <div @click="goForm()" class="c-ph24 c-flex-row c-aligni-center c-justify-sb c-pv26">
      <div class="c-w0 c-flex-grow1 c-fc-xblack c-fw600" :class="classObject">{{formGuideTitle}}</div>
      <div class="c-fs20 c-fc-gray c-mr8" :class="fontSizeClass">{{dataInfo.hasFormLog&&dataInfo.enableEdit==2?'点击修改':formGuideWord}}</div>
      <div class="iconfont c-fs14 c-fc-gray" :class="iconSizeClass">&#xe60e;</div>
    </div>
  </div>
</template>

<script>
import { utilJs } from "@/utils/common.js";
 export default {
  props: {
    topClass: {
      type: String,
      default: 'c-bd-b12-f5',
    },
    fontSizeClass: {
      type: String,
      default: 'c-fs22',
    },
    classObject: {
      type: String,
      default: 'c-fs20',
    },
    iconSizeClass: {
      type: String,
      default: 'c-fs14',
    },
    // 1：课程图文112， 2：音频111， 3：视频110 4：专栏9  5：打卡41 6：训练营78
    // 7:活动7  8：知识套餐61  9：直播51，  11：试卷125  12：测评专题11  13：资料
    // 16：社群10 18：小班课115， 19：商城12，20：个人直播间180  21：电子书142， 24：互动测评
    relType: {
      type: String,
      default: '',
    },
    relId: {
      type: String,
      default: '',
    },
    dataInfo: {
      type: Object,
      default: () => {
        return {}
      }
    },
  },
  data() {
    return {
      formGuideTitle: '报名信息',
      formGuideWord: '填写报名信息',
    }
  },
  created() {
    this.getFormName();
  },
  methods: {
    getFormName() {
      utilJs.getMethod(
        global.apiurl + "k12/forms/getGuideInfo?relId=" + this.relId + "&relType=" + this.relType,
        res => {
          this.formGuideTitle = res.guideTitle ? res.guideTitle : '报名信息';
          this.formGuideWord = res.guideWord ? res.guideWord : '填写报名信息';
        }
      );
    },
    goForm() {
      this.$emit('goForm');
    }
  }
}
</script>